<template>
  <div>
    <div class="top">
      <div class="top-title">考核人员</div>
      <!-- <div>
        <div v-for="(item, index) in jibies" :key="index" class="top-jibie shou" :class="index_jibie === index?'top-select':''" @click="index_jibie=index">{{item.name}}</div>
      </div> -->
    </div>
    <div class="body">
      <div class="body-top">
        <div style="margin-left:30px">
          筛选：
        </div>
        <div class="shou" style="margin-right:22px" :style="status===''?'color:#1E90FB':'color:#666666'" @click="status='';getData()">
          全部
        </div>
        <div class="shou" style="margin-right:22px" :style="status===true?'color:#1E90FB':'color:#666666'" @click="status=true;getData()">
          已批
        </div>
        <div class="shou" style="margin-right:22px" :style="status===false?'color:#1E90FB':'color:#666666'" @click="status=false;getData()">
          未批
        </div>
      </div>
      <div class="card shou" v-for="(item, index) in table" :key="index" @click="toTestPaper(item)">
        <div :class="!item.status?'icon1':'icon2'">{{!item.status?'未批':'已批'}}</div>
        <el-tooltip class="item" effect="dark" :content="item.examineeVo.name" placement="top">
          <div class="card-title shenglue" >{{item.examineeVo.name}}</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.examineeVo.professionName" placement="top">
          <div class="card-text">专业：{{item.examineeVo.professionName}}</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.examineeVo.idcard" placement="top">
          <div class="card-text">身份证号：{{item.examineeVo.idcard}}</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.paperTotalScore+'分'" placement="top">
          <div class="card-text">总分：{{item.paperTotalScore}}分</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.totalScore+'分'" placement="top">
          <div class="card-text1 fl">得分：<span v-if="true" style="color:#1E90FB">{{item.totalScore}}</span><span v-if="true">分</span><span v-if="false">-</span></div>
        </el-tooltip>
        <div v-if="item.status" class="card-text1 fr shou" style="color:#F70D0D;border-bottom: 1px solid #F70D0D">修改分数</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import $httpJSON from '@/utils/request'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data () {
    return {
      status: '',
      span1: 3,
      span2: 9,
      dialogAdd: false,
      index_jibie: 0,
      value: '',
      values: [],
      table: [],
      type: 0,
      jibies: [{
        name: '级别一',
        value: 1,
      }, {
        name: '级别二',
        value: 2,
      }],
      zhuanyes: [{
        panduan: false
      },{
        panduan: false
      }],
      form: {
        id: ''
      }
    }
  },
  mounted() {
    this.form = JSON.parse(localStorage.getItem('info'))
    this.getData()
  },
  methods: {
    getData() {
      this.$httpJSON.get('/examiner/query/examineelist/' + this.$route.query.id, {params: {
        status: this.status
      }}).then(response => {
        if (response.success) {
          this.table = response.data
        } else  {
          this.$message({
            message: response.msg,
            type: 'error',
            duration: 2000
          })
        }
        
      }).catch(error => {
        console.log(error)
      })
    },
    toTestPaper(item) {
      this.$router.push({
          path:"/testPaper",//目标路径
          query:{
              examId: item.examId,//要传的值
              paperId: item.paperId,//要传的值
              id: item.examineeVo.id,//要传的值
          }
      })
    },
    select(val) {
      this.type = val
    }
  }
}
</script>

<style lang="scss" scoped>
.top-jibie{
  float: left;
  width: 60px;
  height: 46px;
  margin-right: 30px;
  color: rgba(153, 153, 153, 100);
  font-size: 14px;
  text-align: center;
  font-family: PingFangSC-Regular;
  display: flex;
  justify-content: center;
  align-items: center;
}
.top-select {
  color: #1890FF;
  border-bottom: 2px solid #1890FF;
}
.top-title{
  // margin-top: -20px;
  float: left;
  width: 100px;
  height: 40px;
  font-size: 16px;
  color: rgba(51, 51, 51, 100);
  font-size: 20px;
  display: flex;
  // justify-content: center;
  // align-items: center;
}
.body{
  display: flex;
  justify-content: space-around;
  // align-items: center;
  flex-wrap: wrap;

  width:100%;
  padding: 20px 24px 20px 24px;
  
}
.body-top{
  width: 100%;
  height: 45px;
  margin-bottom: 20px;
  display: flex;
  // justify-content: center;
  align-items: center;
  color: rgba(102, 102, 102, 100);
  font-size: 14px;
  background-color: white;
}
.card{
  width: 277px;
  height: 174px;
  // height: 144px;
  margin-bottom: 24px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.09);
  padding: 18px 20px 18px 20px;
}
.card-title{
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: bold;
  color: rgba(51, 51, 51, 100);
}
.card-text{
  width: 100%;
  height:25px;
  line-height: 25px;
  // margin-top: 5px;
  font-size: 14px;
  color: rgba(102, 102, 102, 100);
}

.card-text1{
  // width: 50%;
  height:25px;
  line-height: 25px;
  // margin-top: 5px;
  font-size: 14px;
  color: rgba(102, 102, 102, 100);
}
.icon1{
  width: 52px;
  height: 29px;
  margin-top:-18px;
  margin-right:-20px;
  font-size: 14px;
  float: right;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 2px;
  background-color: rgba(30, 144, 251, 1);
  color: white;
}
.icon2{
  width: 52px;
  height: 29px;
  margin-top:-18px;
  margin-right:-20px;
  font-size: 14px;
  float: right;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 2px;
  background-color:rgba(229, 229, 229, 1);
  color: #999999;
}
</style>
